package top.eggcode.modules.user.model;

import lombok.Data;

import java.util.List;

/**
 * Title:
 * Description: TODO
 * Date: 2021/5/11 20:38
 *
 * @author JiaQi Ding
 * @version 1.0
 */
@Data
public class MenuNodeView {

    private String id;

    private String parentId;

    private String name;

    private Short sequence;

    private List<MenuNodeView> children;

    /**
     * 构建视图
     *
     * @param power 实体
     * @return 视图
     */
    public static MenuNodeView build(PowerEntity power) {
        MenuNodeView view = new MenuNodeView();
        view.setId(power.getId());
        view.setParentId(power.getParentId());
        view.setName(power.getName());
        view.setSequence(power.getSequence());
        return view;
    }
}
